﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace InventoryManagementServer
{
    public class DownloadPurchaseOrders : HttpHandlerBase
    {
        public override void ProcessRequest(User user, HttpRequest request, string requestBody, HttpResponse response, ref string responseBody)
        {
            var date = DateTime.Parse(request.Headers["Date"]);

            var orders = DataStore.GetPurchaseOrders(user, date);

            responseBody = XmlSerializer.Serialize(orders);
        }
    }
}